package com.aspire.nm.component.miniServerDemo.clientTest;

import com.alibaba.fastjson.JSON;
import com.aspire.nm.component.commonUtil.httpClient.HttpTookit;
import com.aspire.nm.component.miniServerDemo.Main;
import com.aspire.nm.component.miniServerDemo.bean.Birthday;
import com.aspire.nm.component.miniServerDemo.bean.Person;



public class ServerTest_postJson {

    public static void main(String [] args) throws InterruptedException, InstantiationException, IllegalAccessException{
        new ServerTest_postJson().test();
    }
    
    public void test() {
        
        Person person = new Person();
        person.setName("张三");
        person.setAge(1234);
        
        Birthday birthday = new Birthday();
        birthday.setDay("d");
        birthday.setMonth("m");
        birthday.setYear("y");
        
        System.out.println(new HttpTookit().doPost("http://"+Main.serverIp4Test+":7070/demo/postJson1",JSON.toJSONString(person)));
        System.out.println(new HttpTookit().doPost("http://"+Main.serverIp4Test+":7070/demo/postJson2",JSON.toJSONString(birthday)));
        System.out.println(new HttpTookit().doPost("http://"+Main.serverIp4Test+":7070/demo/postJson1","dfdf"));
    }
    
}

